package com.woniu.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.woniu.entity.dto.QueryRoadDTO;
import com.woniu.entity.vo.RoadVo;
import com.woniu.pojo.Inspector;
import com.woniu.pojo.Road;
import org.apache.ibatis.annotations.Select;

/**
* @author Ma.Lei
* @description 针对表【t_road】的数据库操作Mapper
* @createDate 2022-12-16 23:28:20
* @Entity generator.domain.Road
*/
public interface RoadMapper extends BaseMapper<Road> {

    @Select("select id as roadId from t_road where road_name = #{roadName}")
    String getIdByName(String roadName);
    @Select(" select distinct ti.`inspector_name` from t_road as tr inner join t_inspector as ti \n" +
            " on tr.`inspector_id` = ti.`id` where tr.`inspector_id`=#{id}")
    Inspector getByInspectorName(String id);


    IPage<RoadVo> selectPageRoad(IPage<RoadVo> page, QueryRoadDTO queryRoadDTO);
}




